<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="zozopo.user.operations.*" %>
<%@page import="zozopo.manual.operations.*" %>
<%@taglib prefix="s" uri="/struts-tags"%> 

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

UserTB user = (UserTB)session.getAttribute("userInfo");
if(user == null){
	RequestDispatcher dispatcher = request.getRequestDispatcher("/manual/index.jsp"); 
    dispatcher .forward(request, response); 
    return;
	//跳转
}

ContentImagesOS contentImagesOS = new ContentImagesOS();

ContentImagesTB contentImages = null;
int contentId = (Integer)request.getAttribute("contentId");

try{
	contentImages = contentImagesOS.getByContentIdOrCreatByUserId(contentId,user.getId_user());
	
}finally{
	contentImagesOS.releaseConnection();
}
%>
<!DOCTYPE html>
<html >
<head>
<title>发布新信息 - Zozopo </title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="keywords" content="正品网店推荐" />
<meta http-equiv="description" content="正品网店推荐" />

    
<link rel="stylesheet" href="<%=basePath %>storerecommend/css/andreas09.css" type="text/css" media="screen" />
	<script src="<%=basePath %>jquery/jquery-1.4.2.js"></script> 
<script type='text/javascript' src="<%=basePath %>manual/js/ajaxupload.js"></script>
<script type='text/javascript' src="<%=basePath %>manual/js/xheditor-1.1.14-zh-cn.min.js"></script>

<style>

	div.preview.loading { background: url(<%=basePath %>warehouse/image/loading.gif) no-repeat 19px 20px; }

	</style>

<script>

$(document).ready(function(){

	var thumb = $('#thumb');	

	new AjaxUpload('file', {
		action: 'uploadimage_manual.action',
		name: 'file',
		data: {contentId:<s:property value="contentId"/>,imageNumber:1}, 
		onSubmit: function(file, extension) {
			$('div.preview').addClass('loading');
		},
		onComplete: function(file, response) {
			
			var obj = jQuery.parseJSON(DelHtml(response)); //DelHtml 兼容firefox AND chrom
			
		//	alert(obj);
			
			if(obj.error != undefined){
				alert(obj.error);
				return;
			}
			
			smallImageUrl = obj.smallImageUrl;
			smallImageUrl = smallImageUrl.replace('<PRE>','');
			smallImageUrl = smallImageUrl.replace('</PRE>','');

			var imageUrl =obj.imageUrl;

		//	alert(smallImageUrl);
	
			$('div.preview').removeClass('loading');
			thumb.unbind();
			thumb.attr('src', smallImageUrl+'?');
			thumb.unbind();
			thumb.removeAttr("onclick");   //去除onclick 默认事件
			thumb.click(function() {
				
				$('#context1').val($('#context1').val()+'<img src='+imageUrl+'?'+ '/>');
			});
		}
	});
	});


$(document).ready(function(){

	var thumb2 = $('#thumb2');	

	new AjaxUpload('file2', {
		action: 'uploadimage_manual.action',
		name: 'file',
		data: {contentId:<s:property value="contentId"/>,imageNumber:2}, 
		onSubmit: function(file, extension) {
			$('div.preview2').addClass('loading');
		},
		onComplete: function(file, response) {
			
			var obj = jQuery.parseJSON(DelHtml(response)); //DelHtml 兼容firefox AND chrom
			
			smallImageUrl = obj.smallImageUrl;
			smallImageUrl = smallImageUrl.replace('<PRE>','');
			smallImageUrl = smallImageUrl.replace('</PRE>','');

			var imageUrl = obj.imageUrl;
	
			$('div.preview2').removeClass('loading');
			thumb2.unbind();
			//thumb2.removeAttr("src");
			
			
			thumb2.attr('src', smallImageUrl+'?');

			thumb2.unbind();
			thumb2.removeAttr("onclick"); //去除onclick 默认事件
			thumb2.click(function() {
				//alert('<img src='+imageUrl+'?'+ '/>');
				
				$('#context1').val($('#context1').val()+'<img src='+imageUrl+'?'+ '/>');
				});

		
		}
	});
	});



$(document).ready(function(){

	var thumb3 = $('img#thumb3');	

	new AjaxUpload('file3', {
		action: 'uploadimage_manual.action',
		name: 'file',
		data: {contentId:<s:property value="contentId"/>,imageNumber:3}, 
		onSubmit: function(file, extension) {
			$('div.preview3').addClass('loading');
		},
		onComplete: function(file, response) {

			var obj = jQuery.parseJSON(DelHtml(response)); //DelHtml 兼容firefox AND chrom
			
			smallImageUrl = obj.smallImageUrl;
			smallImageUrl = smallImageUrl.replace('<PRE>','');
			smallImageUrl = smallImageUrl.replace('</PRE>','');

			var imageUrl =obj.imageUrl;
	
			$('div.preview3').removeClass('loading');
			thumb3.unbind();
			thumb3.attr('src', smallImageUrl+'?');
			thumb3.removeAttr("onclick"); //去除onclick 默认事件
			thumb3.click(function() {
				$('#context1').val($('#context1').val()+'<img src='+imageUrl+'?'+ '/>');
				});
		}
	});
	});


$(document).ready(function(){

	var thumb4 = $('img#thumb4');	

	new AjaxUpload('file4', {
		action: 'uploadimage_manual.action',
		name: 'file',
		data: {contentId:<s:property value="contentId"/>,imageNumber:4}, 
		onSubmit: function(file, extension) {
			$('div.preview4').addClass('loading');
		},
		onComplete: function(file, response) {

			var obj = jQuery.parseJSON(DelHtml(response)); //DelHtml 兼容firefox AND chrom
			
			smallImageUrl = obj.smallImageUrl;
			smallImageUrl = smallImageUrl.replace('<PRE>','');
			smallImageUrl = smallImageUrl.replace('</PRE>','');

			var imageUrl =obj.imageUrl;
	
			$('div.preview4').removeClass('loading');
			thumb4.unbind();
			thumb4.attr('src', smallImageUrl+'?');
			thumb4.removeAttr("onclick"); //去除onclick 默认事件
			thumb4.click(function() {
				$('#context1').val($('#context1').val()+'<img src='+imageUrl+'?'+ '/>');
				});
		}
	});
	});


$(document).ready(function(){

	var thumb5 = $('img#thumb5');	

	new AjaxUpload('file5', {
		action: 'uploadimage_manual.action',
		name: 'file',
		data: {contentId:<s:property value="contentId"/>,imageNumber:5}, 
		onSubmit: function(file, extension) {
			$('div.preview5').addClass('loading');
		},
		onComplete: function(file, response) {

			var obj = jQuery.parseJSON(DelHtml(response)); //DelHtml 兼容firefox AND chrom
			
			smallImageUrl = obj.smallImageUrl;
			smallImageUrl = smallImageUrl.replace('<PRE>','');
			smallImageUrl = smallImageUrl.replace('</PRE>','');

			var imageUrl =obj.imageUrl;
	
			$('div.preview5').removeClass('loading');
			thumb5.unbind();
			thumb5.attr('src', smallImageUrl+'?');
			thumb5.removeAttr("onclick"); //去除onclick 默认事件
			thumb5.click(function() {
				$('#context1').val($('#context1').val()+'<img src='+imageUrl+'?'+ '/>');
				});
		}
	});
	});


$(document).ready(function(){

	var thumb6 = $('img#thumb6');	

	new AjaxUpload('file6', {
		action: 'uploadimage_manual.action',
		name: 'file',
		data: {contentId:<s:property value="contentId"/>,imageNumber:6}, 
		onSubmit: function(file, extension) {
			$('div.preview6').addClass('loading');
		},
		onComplete: function(file, response) {

			var obj = jQuery.parseJSON(DelHtml(response)); //DelHtml 兼容firefox AND chrom
			
			smallImageUrl = obj.smallImageUrl;
			smallImageUrl = smallImageUrl.replace('<PRE>','');
			smallImageUrl = smallImageUrl.replace('</PRE>','');

			var imageUrl =obj.imageUrl;
	
			$('div.preview6').removeClass('loading');
			thumb6.unbind();
			thumb6.attr('src', smallImageUrl+'?');
			thumb6.removeAttr("onclick"); //去除onclick 默认事件
			thumb6.click(function() {
				$('#context1').val($('#context1').val()+'<img src='+imageUrl+'?'+ '/>');
				});
		}
	});
	});


$(document).ready(function(){

	var thumb7 = $('img#thumb7');	

	new AjaxUpload('file7', {
		action: 'uploadimage_manual.action',
		name: 'file',
		data: {contentId:<s:property value="contentId"/>,imageNumber:7}, 
		onSubmit: function(file, extension) {
			$('div.preview7').addClass('loading');
		},
		onComplete: function(file, response) {

			var obj = jQuery.parseJSON(DelHtml(response)); //DelHtml 兼容firefox AND chrom
			
			smallImageUrl = obj.smallImageUrl;
			smallImageUrl = smallImageUrl.replace('<PRE>','');
			smallImageUrl = smallImageUrl.replace('</PRE>','');

			var imageUrl =obj.imageUrl;
	
			$('div.preview7').removeClass('loading');
			thumb7.unbind();
			thumb7.attr('src', smallImageUrl+'?');
			thumb7.removeAttr("onclick"); //去除onclick 默认事件
			thumb7.click(function() {
				$('#context1').val($('#context1').val()+'<img src='+imageUrl+'?'+ '/>');
				});
		}
	});
	});

$(document).ready(function(){

	var thumb8 = $('img#thumb8');	

	new AjaxUpload('file8', {
		action: 'uploadimage_manual.action',
		name: 'file',
		data: {contentId:<s:property value="contentId"/>,imageNumber:8}, 
		onSubmit: function(file, extension) {
			$('div.preview8').addClass('loading');
		},
		onComplete: function(file, response) {

			var obj = jQuery.parseJSON(DelHtml(response)); //DelHtml 兼容firefox AND chrom
			
			smallImageUrl = obj.smallImageUrl;
			smallImageUrl = smallImageUrl.replace('<PRE>','');
			smallImageUrl = smallImageUrl.replace('</PRE>','');

			var imageUrl =obj.imageUrl;
	
			$('div.preview8').removeClass('loading');
			thumb8.unbind();
			thumb8.attr('src', smallImageUrl+'?');
			thumb8.removeAttr("onclick"); //去除onclick 默认事件
			thumb8.click(function() {
				$('#context1').val($('#context1').val()+'<img src='+imageUrl+'?'+ '/>');
				});
		}
	});
	});

$(document).ready(function(){

	var thumb9 = $('img#thumb9');	

	new AjaxUpload('file9', {
		action: 'uploadimage_manual.action',
		name: 'file',
		data: {contentId:<s:property value="contentId"/>,imageNumber:9}, 
		onSubmit: function(file, extension) {
			$('div.preview9').addClass('loading');
		},
		onComplete: function(file, response) {

			var obj = jQuery.parseJSON(DelHtml(response)); //DelHtml 兼容firefox AND chrom
			
			smallImageUrl = obj.smallImageUrl;
			smallImageUrl = smallImageUrl.replace('<PRE>','');
			smallImageUrl = smallImageUrl.replace('</PRE>','');

			var imageUrl =obj.imageUrl;
	
			$('div.preview9').removeClass('loading');
			thumb9.unbind();
			thumb9.attr('src', smallImageUrl+'?');
			thumb9.removeAttr("onclick"); //去除onclick 默认事件
			thumb9.click(function() {
				$('#context1').val($('#context1').val()+'<img src='+imageUrl+'?'+ '/>');
				});
		}
	});
	});


$(document).ready(function(){

	var thumb10 = $('img#thumb10');	

	new AjaxUpload('file10', {
		action: 'uploadimage_manual.action',
		name: 'file',
		data: {contentId:<s:property value="contentId"/>,imageNumber:10}, 
		onSubmit: function(file, extension) {
			$('div.preview10').addClass('loading');
		},
		onComplete: function(file, response) {

			var obj = jQuery.parseJSON(DelHtml(response)); //DelHtml 兼容firefox AND chrom
			
			smallImageUrl = obj.smallImageUrl;
			smallImageUrl = smallImageUrl.replace('<PRE>','');
			smallImageUrl = smallImageUrl.replace('</PRE>','');

			var imageUrl =obj.imageUrl;
	
			$('div.preview10').removeClass('loading');
			thumb10.unbind();
			thumb10.attr('src', smallImageUrl+'?');
			thumb10.removeAttr("onclick"); //去除onclick 默认事件
			thumb10.click(function() {
				$('#context1').val($('#context1').val()+'<img src='+imageUrl+'?'+ '/>');
				});
		}
	});
	});

function DelHtml(Word){
	a = Word.indexOf("<");
	b = Word.indexOf(">");
	len = Word.length;
	c = Word.substring(0, a);
	if(b == -1)
	b = a;
	d = Word.substring((b + 1), len);
	Word = c + d;
	tagCheck = Word.indexOf("<");
	if(tagCheck != -1)
	Word = DelHtml(Word);
	return Word;
	} 
	</script>
</head>

<body>
<div id="container">
   
    <div id="wrap">
        <div id="rightside">
            <span id="ad2">
            </span>
        </div>
    <div id="contentalt" > 
    <s:property value="operationResult"/> <s:fielderror id="errormessage" />
    
    
    
    <form id="releaseForm" name="releaseForm" action="savedraft_manual.action" method="post"> 
    
    
         <h1><a href="<%=basePath %>manual/">返回主页</a> -  发布新信息 </h1>     
        
        <p class="box">
        	<input id="contentId" name="contentId" type="hidden" value="<s:property value="contentId"/>">
    		   标题:<input tabindex="1" size="60" value='<s:property value="title"/>' name="title" id="title" > 
    		   <br/> <br/>
			中文品牌称呼: <input id="cnbrand" name="cnbrand" type="text" maxlength="64" value="<s:property value="cnbrand"/>"/>
			英文品牌称呼: <input id="enbrand" name="enbrand" type="text" maxlength="64" value="<s:property value="enbrand"/>"/>			    		
        </p>
       
       
       <div id="contentalt2">
		<div class="seven columns" style="float: left;background: <%=contentImages.getSmall_image_url_1() %>" >
								<div class="preview">
								<%if(contentImages.getImage_url_1() == null || contentImages.getImage_url_1().equals("")){ %>
									<img id="thumb" width="192px"  src="<%=basePath %>manual/alt-img/nopic.png" />
									
									<%}else{ %>
										<img id="thumb" width="192px"  src="<%=contentImages.getSmall_image_url_1() %>" onclick="javascript:$('#context1').val($('#context1').val()+'<img src='+'<%=contentImages.getImage_url_1() %>'+'?'+ '/>');"/>
									<%} %>
								</div>
				 
								<span class="wrap hotness" style="position:absolute;margin-top: -26px;margin-left: 4px;">
									
									
										<input type="button" id="file" name="file" size="20" value="上传图片" />
										
									
								</span> 
							</div>
							
							
							 
							
							<div class="seven columns" style="float: left;">
								<div class="preview2">
									<%if(contentImages.getImage_url_2() == null ){ %>
									<img id="thumb2" width="192px"  src="http://static.paipaiimg.com/upload/item_upload_pic_nopic.png" />
									
									<%}else{ %>
										<img id="thumb2" width="192px"  src="<%=contentImages.getSmall_image_url_2() %>" onclick="javascript:$('#context1').val($('#context1').val()+'<img src='+'<%=contentImages.getImage_url_2() %>'+'?'+ '/>');"/>
									<%} %>
								</div>
				
								<span class="wrap hotness" style="position:absolute;margin-top: -26px;margin-left: 4px;">
									
						
										<input type="button" id="file2" name="file2" size="20"   value="上传图片"  />
								
								</span> 
							</div>
							
							<div class="seven columns" style="float: left;">
								<div class="preview3">
									<%if(contentImages.getImage_url_3() == null ){ %>
									<img id="thumb3" width="192px"  src="http://static.paipaiimg.com/upload/item_upload_pic_nopic.png" />
									
									<%}else{ %>
										<img id="thumb3" width="192px"  src="<%=contentImages.getSmall_image_url_3() %>" onclick="javascript:$('#context1').val($('#context1').val()+'<img src='+'<%=contentImages.getImage_url_3() %>'+'?'+ '/>');"/>
									<%} %>
								</div>
				
								<span class="wrap hotness" style="position:absolute;margin-top: -26px;margin-left: 4px;">
									
						
										<input type="button" id="file3" name="file3" size="20"   value="上传图片"  />
										
									
								</span> 
							</div>
							
							<div class="seven columns" style="float: left;">
								<div class="preview4">
									<%if(contentImages.getImage_url_4() == null ){ %>
									<img id="thumb4" width="192px"  src="http://static.paipaiimg.com/upload/item_upload_pic_nopic.png" />
									
									<%}else{ %>
										<img id="thumb4" width="192px"  src="<%=contentImages.getSmall_image_url_4() %>" onclick="javascript:$('#context1').val($('#context1').val()+'<img src='+'<%=contentImages.getImage_url_4() %>'+'?'+ '/>');"/>
									<%} %>
								</div>
				
								<span class="wrap hotness" style="position:absolute;margin-top: -26px;margin-left: 4px;">
										<input type="button" id="file4" name="file4" size="20"   value="上传图片"  />
								</span> 
							</div>
							
							
<div class="seven columns" style="float: left;">
<div class="preview5">
<%if(contentImages.getImage_url_5() == null ){ %>
<img id="thumb5" width="192px"  src="http://static.paipaiimg.com/upload/item_upload_pic_nopic.png" />								
<%}else{ %>
<img id="thumb5" width="192px"  src="<%=contentImages.getSmall_image_url_5() %>" onclick="javascript:$('#context1').val($('#context1').val()+'<img src='+'<%=contentImages.getImage_url_5() %>'+'?'+ '/>');"/>
<%} %>
</div>
<span class="wrap hotness" style="position:absolute;margin-top: -26px;margin-left: 4px;">
<input type="button" id="file5" name="file5" size="20"   value="上传图片"  />
</span> 
</div>

<div class="seven columns" style="float: left;">
<div class="preview6">
<%if(contentImages.getImage_url_6() == null ){ %>
<img id="thumb6" width="192px"  src="http://static.paipaiimg.com/upload/item_upload_pic_nopic.png" />								
<%}else{ %>
<img id="thumb6" width="192px"  src="<%=contentImages.getSmall_image_url_6() %>" onclick="javascript:$('#context1').val($('#context1').val()+'<img src='+'<%=contentImages.getImage_url_6() %>'+'?'+ '/>');"/>
<%} %>
</div>
<span class="wrap hotness" style="position:absolute;margin-top: -26px;margin-left: 4px;">
<input type="button" id="file6" name="file6" size="20"   value="上传图片"  />
</span> 
</div>

<div class="seven columns" style="float: left;">
<div class="preview7">
<%if(contentImages.getImage_url_7() == null ){ %>
<img id="thumb7" width="192px"  src="http://static.paipaiimg.com/upload/item_upload_pic_nopic.png" />								
<%}else{ %>
<img id="thumb7" width="192px"  src="<%=contentImages.getSmall_image_url_7() %>" onclick="javascript:$('#context1').val($('#context1').val()+'<img src='+'<%=contentImages.getImage_url_7() %>'+'?'+ '/>');"/>
<%} %>
</div>
<span class="wrap hotness" style="position:absolute;margin-top: -26px;margin-left: 7px;">
<input type="button" id="file7" name="file7" size="20"   value="上传图片"  />
</span> 
</div>


<div class="seven columns" style="float: left;">
<div class="preview8">
<%if(contentImages.getImage_url_8() == null ){ %>
<img id="thumb8" width="192px"  src="http://static.paipaiimg.com/upload/item_upload_pic_nopic.png" />								
<%}else{ %>
<img id="thumb8" width="192px"  src="<%=contentImages.getSmall_image_url_8() %>" onclick="javascript:$('#context1').val($('#context1').val()+'<img src='+'<%=contentImages.getImage_url_8() %>'+'?'+ '/>');"/>
<%} %>
</div>
<span class="wrap hotness" style="position:absolute;margin-top: -26px;margin-left: 4px;">
<input type="button" id="file8" name="file8" size="20"   value="上传图片"  />
</span> 
</div>


<div class="seven columns" style="float: left;">
<div class="preview9">
<%if(contentImages.getImage_url_9() == null ){ %>
<img id="thumb9" width="192px"  src="http://static.paipaiimg.com/upload/item_upload_pic_nopic.png" />								
<%}else{ %>
<img id="thumb9" width="192px"  src="<%=contentImages.getSmall_image_url_9() %>" onclick="javascript:$('#context1').val($('#context1').val()+'<img src='+'<%=contentImages.getImage_url_9() %>'+'?'+ '/>');"/>
<%} %>
</div>
<span class="wrap hotness" style="position:absolute;margin-top: -26px;margin-left: 4px;">
<input type="button" id="file9" name="file9" size="20"   value="上传图片"  />
</span> 
</div>

<div class="seven columns" style="float: left;">
<div class="preview10">
<%if(contentImages.getImage_url_10() == null ){ %>
<img id="thumb10" width="192px"  src="http://static.paipaiimg.com/upload/item_upload_pic_nopic.png" />								
<%}else{ %>
<img id="thumb10" width="192px"  src="<%=contentImages.getSmall_image_url_10() %>" onclick="javascript:$('#context1').val($('#context1').val()+'<img src='+'<%=contentImages.getImage_url_10() %>'+'?'+ '/>');"/>
<%} %>
</div>
<span class="wrap hotness" style="position:absolute;margin-top: -26px;margin-left: 4px;">
<input type="button" id="file10" name="file10" size="20"   value="上传图片"  />
</span> 
</div>
</div>


		      
        <br/> <br/>


        <div style="clear:left" id="ad3">
         <textarea id="context1" name="context1" class="xheditor" rows="42" cols="80" style="width: 80%"><s:property value="context1"/></textarea> 

	</div>
	<br/>
        <input type="submit" value="确认发布" onclick="javascript:releaseForm.action='release.action';$('#context1').val();releaseForm.submit();"/>
        <input type="submit" value="保存为草稿" onclick="javascript:releaseForm.submit();"/>
     
     </form>
    </div>
    </div>
    <br>
</div> 
   
<div id="footer"><div>友情链接: <a href="http://www.fobe.cn">FOBE</a> </div>
<p> Powered by Zozopo Work Team 版权所有 2011 粤ICP备11056551号  <img src="http://dt.tongji.linezing.com/tongji.do?unit_id=1826429&amp;uv_id=25291409272505780096&amp;uv_new=0&amp;cna=&amp;cg=&amp;mid=&amp;mmland=&amp;ade=&amp;adtm=&amp;sttm=&amp;cpa=&amp;ss_id=781619180&amp;ss_no=4&amp;ec=1&amp;ref=http%3A//www.zozopo.com/manual/search.action%3Fsearch%3Dvans&amp;url=http%3A//www.zozopo.com/&amp;title=%u6B63%u54C1%u7F51%u5E97%u5BFC%u822A%20-%20Zozopo&amp;charset=UTF-8&amp;domain=zozopo.com&amp;hashval=1054&amp;filtered=0&amp;app=Netscape&amp;agent=Mozilla/5.0%20%28Windows%20NT%206.1%3B%20WOW64%29%20AppleWebKit/536.5%20%28KHTML%2C%20like%20Gecko%29%20Chrome/19.0.1084.56%20Safari/536.5&amp;color=32-bit&amp;screen=1440x900&amp;lg=zh-cn&amp;je=1&amp;fv=11.3%20r300&amp;st=1341220367&amp;vc=ec8f9a20&amp;ut=0&amp;url_id=0&amp;cnu=0.2038719968404621" alt="" width="1" height="1" border="0" /></p>
</div>



</body>

	<script type="text/javascript" src="<%=basePath %>manual/js/jquery.masonry.min.js" charset="utf-8"></script>
<script type="text/javascript">

$(function(){
    
    $('#contentalt2').masonry({
      itemSelector: '.seven'
    });
 
  });
</script>

</html>
 